import config from "@/config"
import http from "@/utils/request"

export default {

	/**
	 * 控制台
	 */
	console: {

	},

	/**
	 * 	个人中心
	 */
	personal: {
		getLoginUserInfo: {
			url: `${config.API_URL}/backstage/auth-api/personal/loginUserInfo`,
			name: "获取当前登录用户信息",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		edit: {
			url: `${config.API_URL}/backstage/auth-api/personal/edit`,
			name: "编辑当前登陆的用户信息",
			put: async function(data={}){
				return await http.put(this.url, data);
			}
		},
		editLoginUserHeadPortrait: {
			url: `${config.API_URL}/backstage/auth-api/personal/edit/headPortrait`,
			name: "编辑当前登录用户的头像",
			put: async function(data={}){
				return await http.put(this.url, data);
			}
		},
		changePassword: {
			url: `${config.API_URL}/backstage/auth-api/personal/changePassword`,
			name: "重置当前登陆账户密码",
			put: async function(data={}){
				return await http.put(this.url, data);
			}
		},
		notice: {
			url: `${config.API_URL}/backstage/auth-api/personal/editNotice`,
			name: "修改用户通知方式",
			put: async function(data={}){
				return await http.put(this.url, data);
			}
		},
		logs: {
			url: `${config.API_URL}/backstage/log-api/operateLog/currentUser/list`,
			name: "查询当前登陆用户操作日志",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		findOperationTypes: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/find/operationType`,
			name: "查询文件来源类型列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		statistics: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/statistics`,
			name: "查询当前登陆用户文件存储数据统计",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		fileList: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/list`,
			name: "查询当前登陆用户文件存储列表",
			get: async function(data={}){
				return await http.get(this.url, data);
			}
		},
		downloadFile: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/download/stream`,
			name: "下载导入模版文件",
			get: async function(params){
				return await http.get_download(this.url, params, {responseType: 'blob'});
			}
		},
		deleteFile: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/delete`,
			name: "删除用户文件",
			delete: async function(params){
				return await http.delete(this.url, params);
			}
		},
		delBatchFile: {
			url: `${config.API_URL}/backstage/auth-api/fileStore/batch/delete`,
			name: "批量删除用户文件",
			delete: async function(params){
				return await http.delete(this.url, params);
			}
		},

	}

}
